﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.IO;
using System.Xml.Serialization;

namespace CrazyClient
{
    public class SongAsset
    {
        public List<string> ScreenAll
        {
            get
            {
                List<string> ret = new List<string>();
                XmlDocument r=new XmlDocument();
                r.LoadXml(_assetXml);
                foreach (XmlNode s in r["song"]["screens"]["all"].ChildNodes)
                    if (s is XmlElement)
                        ret.Add(s.OuterXml);
                return ret;
            }
        }
        public List<string> Controllers
        {
            get
            {
                List<string> ret = new List<string>();
                XmlDocument r = new XmlDocument();
                r.LoadXml(_assetXml);
                foreach (XmlNode s in r["song"]["controllers"].ChildNodes)
                    if (s is XmlElement)
                        ret.Add(s.OuterXml);
                return ret;
            }
        }
        private string _assetXml;
        public SongAsset(string xmlFile)
        {
            _assetXml= File.ReadAllText(xmlFile);
        }

     
    }
}
